package com.itheima.mapper;

import com.itheima.pojo.Shop;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ShopMapper {
    List<Shop> list();

    @Insert("insert into shop_items values (null,#{userId},#{name},#{price},default,default)")
    void addShop(Shop shop);

    @Delete("delete from shop_items where  id=#{id}")
    void deleteById(Integer id);

    @Select("select  * from shop_items where  id= #{id}")
    Shop getById(Integer id);

    void update(Shop shop);
    @Select("select  * from shop_items where  user_id= #{uId}")
    List<Shop> getListById(Integer uId);
}
